<!DOCTYPE html>  
<html lang="zh-CN">  
<head>  
<meta charset="UTF-8">  
<meta name="viewport" content="width=device-width, initial-scale=1.0">  
<title>Devices Screen Mockup</title>  
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/dom-to-image-more/3.3.0/dom-to-image-more.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/tinyColorPicker/1.1.1/jqColorPicker.min.js"></script>
</head>  
<body>  

<div class="controlPanel">
    <button id="introduction" class="btn">使用说明</button>
    <button id="resetScreen" class="btn">清屏</button>
    <button id="mobileOrPC" class="btn">PC端</button>
    <button id="doubleOrSingle" class="btn">单屏</button>
    <button id="save" title="点击保存为图片" class="btn">保存</button>
    <input id="appIconCount" title="输入图标数量" type="number" placeholder="输入图标数量" />
    <input id="watermark" title="清空水印输入空格" placeholder="输入水印" />
    <input id="bgcolor" title="点击选择背景颜色" class="btn colorSelector" placeholder="背景颜色"></input>
    <input id="fontcolor" title="点击选择字体颜色" class="btn colorSelector" placeholder="字体颜色"></input>
</div>
<div class="root_container" id="root_container">
	<div class="bgmask" id="bgmask"></div>
	<div class="second_container" title="点击上传背景图片"></div>
	<div class="copyright"></div>
</div>
<div class="introduction" title="点击隐藏或显示">
	<p>1，基于chrome浏览器的壁纸样机生成器</p>
	<p>2，移动端尺寸：852X1789；PC端尺寸:2016X1260</p>
	<p>3，不联网无法使用</p>
</div>
</body>  


<style>  
.introduction {
	display:none;
	position: absolute;
	left: 0%;
	top:15%;
	width: 49%;
	height: 30%;
	font-family: Arial, sans-serif; /* 设置字体 */
	font-size: 40px; /* 设置字体大小 */
	color: rgb(255, 0, 0); /* 设置文字颜色 */
	line-height: 1.6; /* 设置行高 */
	margin: 20px 0; /* 上下外边距 */
	padding: 10px; /* 内边距 */
	border: 1px solid #ddd; /* 边框 */
	border-radius: 5px; /* 边框圆角 */
	background-color: #f9f9f9; /* 背景色 */
	box-shadow: 7px 5px 4px rgb(29 27 27 / 43%); /* 阴影效果 */
	/* max-width: 600px; */ /* 最大宽度 */
	margin: auto; /* 水平居中 */
}  
.bgmask {
	position: absolute;
	top:0;
	left:0;
	width:100%;
	height:100%;
	filter: blur(30px);
	z-index: 0;
	background-size:cover;
	background-repeat:no-repeat;
	background-position:center center;
}
.sentence {
	font-size:32px;
	color:#fff;
	position:absolute;
	top:29%;
	left:9%;
	font-family:fangsong;
	z-index: 2;
}
#jinrishici-sentence{
	min-width: 600px;
	min-height:50px;
}
.controlPanel {
	position:fixed;
	top:0%;
	/* left:0%; */
	/* width:100%; */
	font-size:32px;
	font-weight:bolder;
	background-color:#02007f4d;
	box-shadow:5px 5px 5px 0px rgb(126 123 123 / 83%);
	display:grid;
	/* grid-template-columns: repeat(8, 200px); */
	justify-content:center;
	align-items:center;
	height: 7%;
	z-index:2;
}
.controlPanel *{
	box-shadow: 5px 5px 5px 0px rgb(212 139 90 / 83%);
}
.controlPanel button {
	font-size:32px;
	color:#fff;
	background-color: #26588d;
	border:none;
	padding:10px 20px;
	border-radius:5px;
	cursor:pointer;
	transition:background-color 0.3s ease;
	margin-left: 5%;
}
.controlPanel input{
	font-size:32px;
	margin-left:10%;
	padding:10px 20px;
	box-sizing: border-box;
	border: 2px solid #8d8d8d;
	border-radius: 4px;
	background-color: rgb(71 89 108);
	font-size: 28px;
	color: #ffffff;
	max-width:100%;
}
.controlPanel input::placeholder{
	color: white; 
}
.third_container {
	position:relative;
	display:grid;
	grid-template-columns:1fr;
	justify-items:center;
	align-items:center;
	z-index: 2;
}
.desc_top {
	font-size:50px;
	color: #fcfcfc;
	text-align:center;
	font-weight:bolder;
}
.watermark-container {
	white-space:nowrap;
	position:absolute;
	top:50%;
	left:45%;
	transform: translate(-50%,-50%) rotate(-59deg);
	font-size:240px;
	color:rgb(255 255 255 / 0%);
	width:100%;
	text-align:center;
	z-index: 2;
	text-shadow:1px 1px 0 #fff,-1px -1px 1px #080808;
	opacity:0.2;
}

.root_container {
	display:grid;
	position:relative;
	grid-template-columns:1fr;
	grid-template-rows:repeat(2,1fr);
	background-color:rgb(224 223 223);
}
.copyright {
	font-size:30px;
	color:#f6f2f2;
	text-align:center;
	font-weight:bolder;
	z-index:1;
}

body {
	display:flex;
	justify-content:center;
	align-items:center;
	height:100%;
	margin:0;
	box-sizing:border-box;
	margin:0;
	padding:0;
}
.second_container {
	display:grid;
	grid-template-columns:1fr;
	column-gap: 21px;
	justify-items:center;
	align-items:center;
	place-items: center;
	z-index: 0;
}
.iphone-screen {
	width:900px;
	height:1600px;
	border:1px solid #ccc;
	border-radius:70px;
	overflow:hidden;
	position:relative;
	background: #a7bda8;
	display:flex;
	justify-content:center;
	align-items:flex-start;
	box-shadow: 11px 12px 17px 2px rgb(59 47 47 / 67%);
	background-size:cover;
	background-repeat:no-repeat;
}
.dynamic-island {
	position:absolute;
	top: 0.5%;
	left:50%;
	transform:translateX(-50%);
	width: 25%;
	height:4%;
	background:black;
	border-radius:38px;
	z-index: 2;
}
.status-bar {
	position:absolute;
	left:7px;
	height:3%;
	width:100%;
	display:flex;
	align-items:center;
	padding:5px 7px 0px 7px;
	justify-content:space-between;
}
.status-icons {
	display:grid;
	width: 15%;
	grid-template-columns:repeat(3,1fr);
	gap:10px;
	align-items:center;
	justify-content:right;
	padding-right: 9%;
	place-items: center;
}
.status-icon {
	height:auto;
	display:block;
}
.signal {
	width: 100%;
}
.wifi {
	width: 100%;
}
.battery {
	width: 123%;
}
.status-text {
	padding-left:5%;
	display:inline-block;
	width: 50%;
	font-size: 23px;
	color:white;
}
.torch,.camera {
	position:absolute;
	bottom:41px;
	width:16%;
	padding:3%;
	height:auto;
	border-radius:99%;
	background:#5e5d5d33;
	display:flex;
	justify-content:center;
	align-items:center;
}
.torch {
	left:33px;
}
.camera {
	right:33px;
}
.app-icons-container {
	display:grid;
	row-gap:4%;
	height:100%;
	width:100%;
	box-sizing:border-box;
	flex-wrap:wrap;
	place-items: center;
	padding:17% 0% 2% 0%;
	grid-template-columns:repeat(4,1fr);
	grid-template-rows: repeat(8,12.5%);
	margin: 0 auto;
}
.app-item {
	display:flex;
	flex-direction:column;
	align-items:center;
	justify-content:center;
	box-sizing:border-box;
	z-index:1;
	width: 100%;
}
.app-icon {
	border-radius: 28%;
	display:flex;
	justify-content:center;
	align-items:center;
	z-index:1;
	width: 80%;
	aspect-ratio:1 / 1;
	background-color:rgb(255 255 255 / 0%);
	box-sizing:border-box;
	overflow:hidden;
}
.app-icon img{
	max-width: 100%;
	max-height: 100%;
	object-fit: cover;
}
.app-name {
	font-size: calc(1vw);
	text-align:center;
	color:white;
	margin-top: 4%;
	display:none;
	width: 170px;
	white-space:nowrap;
	overflow: hidden;
}
.bottom-bar {
	position:absolute;
	z-index:0;
	bottom: 4.5%;
	width:98%;
	height:13%;
	background-color:#ffffff4f;
	border-radius:23px;
	display:block;
}
.bottom-line {
	position:absolute;
	bottom:10px;
	width:30%;
	height:0.5%;
	background-color:white;
	filter:brightness(1) contrast(2.2);
}
.time-display {
	z-index:1;
	position:absolute;
	top:12%;
	left:50%;
	transform:translateX(-50%);
	width:100%;
	text-align:center;
	color:#fff;
	text-shadow:1px 1px 2px rgba(0,0,0,0.5);
}
.time-display .date {
	font-weight:bold;
	text-align:center;
}
.time-display .time {
	font-size:20px;
	text-align:center;
	font-family:serifemoji;
}
.weather {
	z-index:1;
	position:absolute;
	width:13%;
	top:12%;
	left:71%;
	font-size:20px;
	color:white;
}
.weather svg {
	display:none;
	width:60%;
	height:60%;
}

</style>  
<script>
$(document).ready(function() {
	//rotateScreen();
	initScreen();
	bindEvent();
	inputWithDefault();
	$('body').css('transform','scale(0.5)');
	resetCtrlPanel();
	$('.app-icons-container').focus();
	console.log($('.second_container').offset())
	$('html, body').animate({  
	    scrollTop: $('.second_container').offset().top,
	    scrollLeft: $('.second_container').offset().left-200
	}, 500); 
});

function resetCtrlPanel(){
	let bodyW = $('.second_container').css('width').replace('px','');
	bodyW = Math.floor(Number(bodyW));
	let colCount = 8;
	let colWidth = Math.floor(bodyW/colCount);
	$('.controlPanel').css('grid-template-columns','repeat('+colCount+', '+colWidth+'px)');
}


function DeviceConfig(type, screenWidth, screenHeight, iconsRowCount,iconCntOneRow){
	this.type=type;
	this.iconsRowCount=iconsRowCount;
	this.screenWidth=screenWidth;
	this.screenHeight=screenHeight;
	this.iconCntOneRow=iconCntOneRow;
	this.enlarge='scale(1.1)';
	this.createdScreens={};
}
DeviceConfig.prototype.commonResizeBoard=function(rootWidth, rootHeight){
	secondHeight = rootHeight-100;
	$('.root_container').css('width',rootWidth);
	$('.root_container,.second_container').css('height',rootHeight);
	$('.second_container').css('height',secondHeight);
	$('.second_container').click(function(){
		uploadImg(this);
		event.stopPropagation();
	});
	$('body,html').css('width',rootWidth);
	
}
DeviceConfig.prototype.commonEvent=function(){
	$('#jinrishici-sentence').hover(function(event){
		$(this).css('background-color','gray');
		$(this).attr('contenteditable',true);
	},function(){
		$(this).css('background-color','');
		$(this).attr('contenteditable',false);
	});
	$('#jinrishici-sentence').click(function(event){
		event.stopPropagation();
	})
}
DeviceConfig.prototype.clear=function(){
	for (let key in this.createdScreens) {
		this.createdScreens[key].remove();
		delete this.createdScreens[key]
	}
}
DeviceConfig.prototype.getVisibleScreenCount=function(){
	let visibleCount = 0;
	for(let key in this.createdScreens){
		let screen=this.createdScreens[key];
		if('none'!=screen.css('display')){
			visibleCount=visibleCount+1;
		}
	}
	return visibleCount;
}

function PC(){
	DeviceConfig.call(this,'pc', 2016,1260,6,12);  
}
function Mobile(){
	DeviceConfig.call(this,'mobile', 852,1789,4,4);  
}

PC.prototype = Object.create(DeviceConfig.prototype);  
PC.prototype.constructor = PC;
PC.prototype.resizeBoard=function(){
	rootWidth = Math.floor(this.screenWidth+(this.screenWidth*0.3));
	rootHeight = Math.floor(this.screenHeight*2+(this.screenHeight*0.3));
	this.commonResizeBoard(rootWidth, rootHeight);
}
PC.prototype.createScreens = function(){
	let existScreenCount = Object.keys(this.createdScreens).length;
	this.clear();
	if(existScreenCount==1 || existScreenCount==0){
		createHomeScreen();
		createLockScreen();
	}
	if(existScreenCount==2){
		createHomeScreen();
		let $home = context.getDevice()['createdScreens']['home'];
		$home[0].style.transform = this.enlarge;
	}
	this.screenLayout();
	this.commonEvent();
	$('.app-icons-container').css('grid-template-columns',this.gridColumns());
	$('.app-icons-container').css('grid-template-rows',this.gridRows());
	$('.app-icons-container').css('row-gap','1%');
	$('.app-item').css('width','auto');
	$('.app-icons-container').css('padding','3% 0 0 0');
	$('.app-icons-container').css('width',this.screenWidth);
	$('.app-icons-container').css('height',this.screenHeight);
	$('.dynamic-island').css('display','none');
	$('.bottom-bar').css('bottom','2.5%');
	$('.bottom-bar').css('height','17%');
	$('.watermark-container').css('transform','translate(-50%,-50%) rotate(30deg)');
	$('.status-bar').css('height','4%');
	$('.status-icons').css('padding-right','3%');
	$('.torch,.camera').css('display','none');
	$('.status-text.isp').css('padding-left','3%');
	$('.status-icon').css('width',Math.floor(this.screenWidth/40));
	$('.status-icons').css('width',Math.floor(this.screenWidth/15));
	$('').css('','');
	$('').css('','');
}
PC.prototype.screenLayout = function(){
	let visibleCount = this.getVisibleScreenCount();
	if(visibleCount==1 || visibleCount==0){
		$('.second_container').css('grid-template-rows','1fr');
	}
	if(visibleCount==2){
		$('.second_container').css('grid-template-columns','1fr');
		$('.second_container').css('grid-template-rows','repeat(2, 1fr)');
	}
}

Mobile.prototype = Object.create(DeviceConfig.prototype);  
Mobile.prototype.constructor = Mobile;
Mobile.prototype.resizeBoard=function(){
	rootWidth = Math.floor(this.screenWidth*2+(this.screenWidth*0.3));
	rootHeight = Math.floor(this.screenHeight+(this.screenHeight*0.3));
	this.commonResizeBoard(rootWidth, rootHeight);
}
Mobile.prototype.createScreens = function(){
	let existScreenCount = Object.keys(this.createdScreens).length;
	this.clear();
	if(existScreenCount==1 || existScreenCount==0){
		createHomeScreen();
		createLockScreen();
	}
	if(existScreenCount==2){
		createHomeScreen();
		let $home = context.getDevice()['createdScreens']['home'];
		$home[0].style.transform = this.enlarge;
	}
	this.screenLayout();
	this.commonEvent();
	$('.app-icons-container').css('grid-template-columns',this.gridColumns());
	$('.app-icons-container').css('grid-template-rows',this.gridRows());
	$('.app-icons-container').css('row-gap','2%');
	$('.second_container').css('place-items','center');
	let statuIconWidth = Math.floor(this.screenWidth/20);
	$('.status-icon').css('width',statuIconWidth);
}
Mobile.prototype.screenLayout = function(){
	let visibleCount = this.getVisibleScreenCount()
	if(visibleCount==1 || visibleCount==0){
		$('.second_container').css('grid-template-columns','1fr');
	}
	if(visibleCount==2){
		$('.second_container').css('grid-template-columns', '1fr 1fr');
	}
	$('.second_container').css('grid-template-rows', '');
}
DeviceConfig.prototype.totalAppItems=function(){
	let appItemWidth = Math.floor(this.screenWidth/this.iconCntOneRow);
	let totalRows = (Math.floor(this.screenHeight/appItemWidth));
	let totalCount = totalRows*this.iconCntOneRow;
	if(this.type=='mobile'){
		return totalCount-8;
	}else{
		return totalCount-12;
	}
}
DeviceConfig.prototype.gridColumns=function(){
	let columnWidth = Math.floor(this.screenWidth/this.iconCntOneRow);
	return 'repeat('+this.iconCntOneRow+', '+columnWidth+'px)';
}
DeviceConfig.prototype.gridRows=function(){
	let columnWidth = Math.floor(this.screenWidth/this.iconCntOneRow);
	let oneRowHeight = columnWidth+columnWidth*0.1;
	let rowCount = Math.floor(this.screenHeight/oneRowHeight);
	return 'repeat('+rowCount+', '+oneRowHeight+'px)';
}
context={
	type: 'mobile',
    pc: new PC(),  
    mobile: new Mobile(),
    getDevice:function(){
		return this[this.type]
	}
}

function initScreen(){
	context.getDevice().resizeBoard();
	context.getDevice().createScreens();
	
}


let screenTemplate={
	'third_container':'<div class="third_container"></div>',
	'watermark':'<div class="watermark-container"></div>',
	'desc_top':'<div class="desc_top"></div>',
	'iphone_screen':'<div title="点击选择并上传壁纸" class="iphone-screen" id="iphone-screen"></div>',
	'dynamic_island':'<div title="点击隐藏" class="dynamic-island"></div>',
	'time_display':'<div class="time-display"><div class="date"></div><div class="time"></div></div>',
	'status_bar':'<div class="status-bar"><div class="status-text isp">中国移动</div><div class="status-icons"><div class="status-icon signal"><svg width="100%"height="100%"viewBox="0 0 1400 1200"preserveAspectRatio="xMidYMid "version="1.1"xmlns="http://www.w3.org/2000/svg"fill="#FFFFFF"><path d="M0 727.578947l188.631579 0 0 296.421053-188.631579 0 0-296.421053Z"></path><path d="M269.473684 565.894737l188.631579 0 0 458.105263-188.631579 0 0-458.105263Z"></path><path d="M565.894737 377.263158l161.684211 0 0 646.736842-161.684211 0 0-646.736842Z"></path><path d="M835.368421 188.631579l188.631579 0 0 835.368421-188.631579 0 0-835.368421Z"></path><path d="M1104.842105 0l188.631579 0 0 1024-188.631579 0 0-1024Z"></path></svg></div><div class="status-icon wifi"><svg width="100%"height="100%"viewBox="0 0 1000 1000"preserveAspectRatio="xMidYMid "version="1.1"xmlns="http://www.w3.org/2000/svg"fill="#FFFFFF"><path d="M478.03605 495.007C358.18605 507.88 270.63805 593.762 247.01905 633.34c-14.787 24.778-6.69 56.847 18.085 71.633 8.393 5.008 17.616 7.393 26.726 7.393 17.787 0 35.132-9.092 44.91-25.479 10.072-16.874 71.244-79.269 152.452-87.991 68.809-7.376 137.709 25.217 204.772 96.912 19.715 21.063 52.775 22.166 73.843 2.459 21.071-19.711 22.175-52.771 2.468-73.843-112.98-120.767-221.263-137.027-292.239-129.417z"></path><path d="M513.39305 700.749c-55.4 0-100.31 44.907-100.31 100.306s44.91 100.307 100.31 100.307c55.395 0 100.306-44.908 100.306-100.307S568.78805 700.749 513.39305 700.749zM1008.17105 350.85C840.37705 187.594 660.63005 111.217 473.93005 123.848c-108.92 7.369-220.504 46.655-322.681 113.614C72.00105 289.396 22.28105 341.825 11.11405 356.097c-17.783 22.72-13.815 55.605 8.907 73.387 9.568 7.49 20.923 11.122 32.191 11.122 15.49 0 30.817-6.865 41.107-20.017 7.055-8.749 50.226-53.609 118.01-97.563 61.02-39.57 157.938-88.2 273.119-95.15 154.619-9.298 306.324 57.237 450.861 197.862 20.684 20.125 53.752 19.669 73.873-1.012 20.122-20.682 19.671-53.757-1.011-73.876z"></path><path d="M487.43005 307.044c-197.071 9.085-329.162 149.714-353.641 177.811-18.954 21.756-16.681 54.758 5.074 73.709 9.901 8.624 22.122 12.852 34.296 12.852 14.578 0 29.085-6.07 39.416-17.926 11.998-13.775 121.8-134.792 279.667-142.069 107.595-4.936 216.103 44.011 322.504 145.547 20.882 19.924 53.945 19.151 73.861-1.728 19.924-20.873 19.148-53.944-1.726-73.862C759.02805 359.37 624.62705 300.719 487.43005 307.044z"></path></svg></div><div class="status-icon battery"><svg width="130%"height="100%"viewBox="0 0 1000 1000"preserveAspectRatio="xMidYMid "version="1.1"xmlns="http://www.w3.org/2000/svg"fill="#FFFFFF"><path d="M835.842643 307.552631c14.518668 0 27.396977 5.941316 38.619576 17.822924 11.222599 11.881608 16.833387 25.090445 16.833387 39.616276l0 247.578702c0 13.199627-5.610788 25.453718-16.833387 36.641525-11.222599 11.222599-24.100908 16.833387-38.619576 16.833387l-718.964702 0c-13.208836 0-25.419949-5.610788-36.641525-16.833387-11.222599-11.18883-16.842597-23.441898-16.842597-36.641525l0-247.578702c0-14.526855 5.619998-27.734668 16.842597-39.616276 11.222599-11.881608 23.433712-17.822924 36.641525-17.822924L835.842643 307.552631zM116.877941 349.146958c-6.608511 0-10.56359 0.700965-11.889795 1.977028-1.318018 1.318018-1.977028 5.941316-1.977028 13.867846l0 247.578702c0 6.642281 0.659009 12.582573 1.977028 17.822924 1.327228 5.281283 5.281283 7.918343 11.889795 7.918343l718.964702 0c6.600325 0 10.234085-2.63706 10.893094-7.918343 0.659009-5.239328 0.988514-11.180644 0.988514-17.822924l0-247.578702c0-7.92653-0.329505-12.548804-0.988514-13.867846-0.659009-1.276063-4.29277-1.977028-10.893094-1.977028L116.877941 349.146958zM570.432831 384.791783l0 205.984375-425.828408 0L144.604422 384.791783 570.432831 384.791783zM903.177214 420.444794c22.453385 0 37.309744 5.941316 44.569078 17.831111 7.259334 11.881608 10.893094 28.428469 10.893094 49.51267 0 21.126156-3.63376 37.960567-10.893094 50.509371-7.259334 12.582573-22.115694 18.811438-44.569078 18.811438L903.177214 420.444794z"></path></svg></div></div></div>',
	'weather':'<div class="weather"id="weather"><svg id="thunderstorm"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"><path d="M777.955556 422.4H768a118.044444 118.044444 0 0 0-12.8-85.333333 115.2 115.2 0 0 0-71.111111-55.466667 108.088889 108.088889 0 0 0-76.8 4.266667L267.377778 585.955556a4.266667 4.266667 0 0 0 2.844444 7.111111h512a85.333333 85.333333 0 0 0 85.333334-93.866667 88.177778 88.177778 0 0 0-89.6-76.8z"fill="#A1C6E6"></path><path d="M420.977778 196.266667a145.066667 145.066667 0 0 0-143.644445 132.266666v25.6h-14.222222a143.644444 143.644444 0 0 0-35.555555 2.844445h-1.422223c-42.666667 9.955556-82.488889 51.2-83.911111 95.288889a100.977778 100.977778 0 0 0 71.111111 98.133333 9.955556 9.955556 0 0 0 9.955556-2.844444l312.888889-277.333334a8.533333 8.533333 0 0 0 1.422222-12.8 142.222222 142.222222 0 0 0-116.622222-61.155555z"fill="#C3D6E6"></path><path d="M658.488889 668.444444H682.666667v90.737778h-24.177778zM708.266667 615.822222h24.177777v74.524445h-24.177777z"fill="#A1C6E6"></path><path d="M379.733333 625.777778h24.177778v120.32h-24.177778zM265.955556 625.777778h24.177777v71.537778h-24.177777zM315.733333 665.6h24.177778v119.324444h-24.177778z"fill="#C3D6E6"></path><path d="M587.377778 658.488889H611.555556v169.244444h-24.177778z"fill="#A1C6E6"></path><path d="M466.488889 627.2h85.333333l-46.933333 86.755556h55.466667l-99.555556 120.888888 18.488889-83.911111h-34.133333l21.333333-123.733333z"fill="#F7B531"></path></svg><svg id="sunny"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"><path d="M511.4 512.2m-246.6 0a246.6 246.6 0 1 0 493.2 0 246.6 246.6 0 1 0-493.2 0Z"fill="#9FDAFF"></path><path d="M520.4 211.8h-16.7c-9 0-16.3-7.3-16.3-16.3V41.3c0-9 7.3-16.3 16.3-16.3h16.7c9 0 16.3 7.3 16.3 16.3v154.1c0 9-7.4 16.4-16.3 16.4zM304.1 295.3l-11.8 11.8c-6.3 6.3-16.7 6.3-23.1 0l-109-109c-6.3-6.3-6.3-16.7 0-23.1l11.8-11.8c6.3-6.3 16.7-6.3 23.1 0l109 109c6.3 6.3 6.3 16.7 0 23.1zM210.2 507.2v16.7c0 9-7.3 16.3-16.3 16.3H39.8c-9 0-16.3-7.3-16.3-16.3v-16.7c0-9 7.3-16.3 16.3-16.3h154.1c9 0 16.3 7.3 16.3 16.3zM293.7 723.5l11.8 11.8c6.3 6.3 6.3 16.7 0 23.1l-109 109c-6.3 6.3-16.7 6.3-23.1 0l-11.8-11.8c-6.3-6.3-6.3-16.7 0-23.1l109-109c6.4-6.4 16.7-6.4 23.1 0zM505.6 817.4h16.7c9 0 16.3 7.3 16.3 16.3v154.1c0 9-7.3 16.3-16.3 16.3h-16.7c-9 0-16.3-7.3-16.3-16.3V833.7c0-9 7.4-16.3 16.3-16.3zM721.9 733.9l11.8-11.8c6.3-6.3 16.7-6.3 23.1 0l109 109c6.3 6.3 6.3 16.7 0 23.1L854 865.9c-6.3 6.3-16.7 6.3-23.1 0l-109-109c-6.3-6.3-6.3-16.7 0-23zM815.8 521.9v-16.7c0-9 7.3-16.3 16.3-16.3h154.1c9 0 16.3 7.3 16.3 16.3v16.7c0 9-7.3 16.3-16.3 16.3H832.1c-9 0-16.3-7.3-16.3-16.3zM732.3 305.7l-11.8-11.8c-6.3-6.3-6.3-16.7 0-23.1l109-109c6.3-6.3 16.7-6.3 23.1 0l11.8 11.8c6.3 6.3 6.3 16.7 0 23.1l-109 109c-6.4 6.3-16.7 6.3-23.1 0z"fill="#9FDAFF"></path></svg><svg id="lsnow"viewBox="0 0 1177 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"><path d="M1031.350714 366.887701h-16.427808a191.657754 191.657754 0 0 0-20.078431-138.723708 197.13369 197.13369 0 0 0-114.994653-91.265597 184.356506 184.356506 0 0 0-125.946524 9.126559L204.484404 631.557932a5.475936 5.475936 0 0 0 3.650623 10.951872h830.516934a138.723708 138.723708 0 0 0 136.898396-151.500891 142.374332 142.374332 0 0 0-144.199643-124.121212z"fill="#A1C6E6"></path><path d="M452.726828 0a233.639929 233.639929 0 0 0-231.814617 213.561497l-3.650624 41.982175h-21.903743a304.827094 304.827094 0 0 0-58.409982 3.650624h-1.825312C65.760696 273.796791 1.874778 341.333333 0.049466 412.520499a162.452763 162.452763 0 0 0 113.16934 158.802139 21.903743 21.903743 0 0 0 18.25312-3.650624L640.733958 118.645276a16.427807 16.427807 0 0 0 1.825312-20.078431A231.814617 231.814617 0 0 0 452.726828 0z"fill="#CFDBE6"></path><path d="M733.824867 949.16221l-25.554367-14.602495 25.554367-14.602496a21.903743 21.903743 0 0 0 9.12656-29.204991 21.903743 21.903743 0 0 0-31.030303-7.301248l-23.729056 14.602496v-29.204991a21.903743 21.903743 0 0 0-21.903743-21.903743 21.903743 21.903743 0 0 0-21.903743 21.903743v29.204991l-25.554367-14.602496a21.903743 21.903743 0 0 0-21.903744 36.506239l25.554368 14.602496-25.554368 14.602495a20.078431 20.078431 0 0 0-7.301247 29.204991 21.903743 21.903743 0 0 0 29.204991 9.12656l25.554367-14.602495v29.204991a21.903743 21.903743 0 0 0 21.903743 21.903743 23.729055 23.729055 0 0 0 21.903743-21.903743v-29.204991l23.729056 14.602495a23.729055 23.729055 0 0 0 31.030303-9.12656 21.903743 21.903743 0 0 0-9.12656-29.204991zM960.163548 907.180036l-14.602496-7.301248 14.602496-9.12656a12.777184 12.777184 0 0 0-12.777184-20.078431l-14.602495 7.301248v-16.427808a12.777184 12.777184 0 0 0-12.777184-12.777184 12.777184 12.777184 0 0 0-10.951871 12.777184v16.427808l-14.602496-7.301248a12.777184 12.777184 0 0 0-12.777184 20.078431l14.602496 9.12656-14.602496 7.301248a12.777184 12.777184 0 0 0-3.650623 16.427807 10.951872 10.951872 0 0 0 16.427807 5.475936l14.602496-9.12656v16.427808a12.777184 12.777184 0 0 0 10.951871 12.777183 12.777184 12.777184 0 0 0 12.777184-12.777183v-16.427808l14.602495 9.12656a10.951872 10.951872 0 0 0 16.427808-5.475936 12.777184 12.777184 0 0 0-3.650624-16.427807zM633.43271 735.600713l-10.951871-5.475936 10.951871-7.301248c5.475936-1.825312 5.475936-7.301248 3.650624-12.777183a9.12656 9.12656 0 0 0-12.777184-1.825312l-10.951871 5.475936v-12.777184a9.12656 9.12656 0 0 0-9.12656-9.12656 9.12656 9.12656 0 0 0-9.12656 9.12656v12.777184l-9.126559-5.475936a9.12656 9.12656 0 0 0-12.777184 1.825312 7.301248 7.301248 0 0 0 3.650624 12.777183l9.12656 7.301248-9.12656 5.475936a7.301248 7.301248 0 0 0-3.650624 12.777184 10.951872 10.951872 0 0 0 12.777184 3.650623l9.126559-7.301247v12.777183a9.12656 9.12656 0 0 0 9.12656 9.12656 9.12656 9.12656 0 0 0 9.12656-9.12656v-12.777183l10.951871 7.301247a10.951872 10.951872 0 0 0 12.777184-3.650623c1.825312-5.475936 1.825312-10.951872-3.650624-12.777184zM876.199199 755.679144l-16.427808-9.126559 16.427808-9.12656a14.602496 14.602496 0 0 0 5.475935-20.078431 14.602496 14.602496 0 0 0-20.078431-5.475936l-16.427807 9.126559v-20.078431a14.602496 14.602496 0 0 0-14.602496-14.602495 14.602496 14.602496 0 0 0-12.777184 14.602495v20.078431l-16.427807-10.951871a16.427807 16.427807 0 0 0-20.078431 5.475936 14.602496 14.602496 0 0 0 5.475935 20.078431l16.427808 10.951872-16.427808 9.126559a14.602496 14.602496 0 0 0-5.475935 20.078432 16.427807 16.427807 0 0 0 20.078431 5.475936l16.427807-10.951872v20.078431a14.602496 14.602496 0 1 0 29.204991 0v-20.078431l16.427808 10.951872a14.602496 14.602496 0 1 0 14.602496-25.554368z"fill="#A1C6E6"></path><path d="M418.045901 762.980392l-20.078431-12.777183 20.078431-10.951872a18.253119 18.253119 0 1 0-18.25312-32.855615l-20.078431 12.777184v-23.729056a18.253119 18.253119 0 0 0-18.253119-18.253119 16.427807 16.427807 0 0 0-18.25312 18.253119v23.729056l-21.903743-12.777184a18.253119 18.253119 0 0 0-18.25312 32.855615l21.903744 10.951872-21.903744 12.777183a20.078431 20.078431 0 0 0-7.301247 25.554367 20.078431 20.078431 0 0 0 25.554367 5.475936l21.903743-10.951871v23.729055a18.253119 18.253119 0 0 0 18.25312 18.253119 20.078431 20.078431 0 0 0 18.253119-18.253119v-23.729055l20.078431 10.951871a20.078431 20.078431 0 0 0 25.554368-5.475936 20.078431 20.078431 0 0 0-7.301248-25.554367zM240.990642 865.197861l-16.427807-9.12656 16.427807-10.951871a14.602496 14.602496 0 0 0 5.475936-20.078432 14.602496 14.602496 0 0 0-20.078431-3.650624l-16.427808 9.12656v-20.078431a14.602496 14.602496 0 0 0-14.602495-14.602496 16.427807 16.427807 0 0 0-14.602496 14.602496v20.078431L164.327541 821.390374a14.602496 14.602496 0 0 0-20.078432 3.650624 14.602496 14.602496 0 0 0 5.475936 20.078432l16.427808 10.951871-16.427808 9.12656a14.602496 14.602496 0 0 0-5.475936 20.078431 16.427807 16.427807 0 0 0 20.078432 5.475936l16.427807-10.951871v20.078431a16.427807 16.427807 0 0 0 14.602496 14.602495 14.602496 14.602496 0 0 0 14.602495-14.602495v-20.078431l16.427808 10.951871a16.427807 16.427807 0 0 0 20.078431-5.475936 14.602496 14.602496 0 0 0-5.475936-20.078431zM527.564617 909.005348l-10.951871-7.301248 10.951871-5.475936a10.951872 10.951872 0 0 0 3.650624-12.777184 9.12656 9.12656 0 0 0-12.777183-3.650623l-10.951872 7.301247v-12.777183a10.951872 10.951872 0 1 0-20.078431 0v12.777183l-10.951872-7.301247a9.12656 9.12656 0 0 0-12.777184 3.650623 10.951872 10.951872 0 0 0 3.650624 12.777184l10.951872 5.475936-10.951872 7.301248a10.951872 10.951872 0 0 0-3.650624 12.777183 12.777184 12.777184 0 0 0 12.777184 3.650624l10.951872-7.301248v12.777184a9.12656 9.12656 0 0 0 9.126559 9.12656 10.951872 10.951872 0 0 0 10.951872-9.12656v-12.777184l10.951872 7.301248a12.777184 12.777184 0 0 0 12.777183-3.650624 10.951872 10.951872 0 0 0-3.650624-12.777183z"fill="#CFDBE6"></path></svg></div>',
	'sentence':'<div title="点击输入" class="sentence"><div id="jinrishici-sentence"></div><script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js"charset="utf-8"><\/script></div>',
	'torch':'<div class="torch"><svg width="100%"height="100%"viewBox="0 0 1000 1000"preserveAspectRatio="xMidYMid "version="1.1"xmlns="http://www.w3.org/2000/svg"fill="#FFFFFF"><path d="M876.13 511.55c-6.74 0-13.49-2.57-18.63-7.72L520.15 166.49c-4.94-4.94-7.72-11.65-7.72-18.63s2.78-13.69 7.72-18.63l42.1-42.1c30.81-30.82 80.97-30.84 111.81-0.01l262.79 262.81c30.82 30.83 30.82 80.98 0 111.8l-42.1 42.1a26.26 26.26 0 0 1-18.62 7.72zM576.06 147.86l300.07 300.07 23.47-23.47c10.27-10.27 10.27-26.99 0-37.27l-262.8-262.8c-10.28-10.28-27.02-10.26-37.28 0.01l-23.46 23.46z"></path><path d="M632.45 584.55c-6.88 0-13.61-2.7-18.63-7.72L447.15 410.16a26.322 26.322 0 0 1-6.6-26.23l73.42-244.08c2.67-8.88 9.81-15.7 18.8-17.96 8.98-2.26 18.52 0.37 25.07 6.92l337.34 337.34a26.33 26.33 0 0 1 6.92 25.07 26.336 26.336 0 0 1-17.96 18.8l-244.08 73.41c-2.51 0.76-5.07 1.12-7.61 1.12zM495.56 384.03l144.39 144.39 186.78-56.18-274.99-274.99-56.18 186.78z"></path><path d="M235.18 960c-21.12 0-40.97-8.22-55.91-23.16L87.14 844.7c-30.83-30.83-30.83-80.98 0-111.8l359.6-359.59a26.366 26.366 0 0 1 18.63-7.72c6.99 0 13.69 2.78 18.63 7.72l166.67 166.67c10.29 10.29 10.29 26.98 0 37.27L291.09 936.84C276.16 951.77 256.31 960 235.18 960z m230.19-530.79L124.41 770.16c-10.28 10.28-10.28 27 0 37.27l92.14 92.14c9.96 9.96 27.33 9.96 37.27 0l340.96-340.96-129.41-129.4z"></path><path d="M391.67 690.82c-13.49 0-26.99-5.14-37.27-15.42l-5.82-5.82c-20.55-20.55-20.55-53.99 0-74.54l42.1-42.1c20.55-20.55 53.98-20.55 74.53 0l5.84 5.84c9.94 9.94 15.43 23.18 15.43 37.26 0 14.08-5.49 27.32-15.45 37.27l-42.09 42.1c-10.28 10.27-23.78 15.41-37.27 15.41z m36.26-100.62l-42.09 42.11 5.85 5.85 42.07-42.12-5.83-5.84z"></path></svg></div>',
	'camera':'<div class="camera"><svg version="1.0"xmlns="http://www.w3.org/2000/svg"width="100%"height="100%"viewBox="0 0 512.000000 512.000000"preserveAspectRatio="xMidYMid meet"><g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"fill="#FFFFFF"stroke="none"><path d="M2049 3974 c-42 -21 -99 -72 -255 -230 -111 -112 -214 -208 -228 -214 -15 -5 -43 -10 -62 -10 l-34 0 0 55 c0 46 -4 60 -25 80 -23 24 -28 25 -179 25 -85 0 -162 -3 -171 -6 -25 -10 -45 -58 -45 -109 l0 -45 -58 0 c-115 0 -234 -54 -292 -133 -63 -86 -61 -39 -58 -1073 l3 -939 28 -56 c32 -67 109 -142 175 -172 l47 -22 1680 0 1680 0 53 29 c65 36 107 82 141 156 l26 55 3 952 c2 951 2 951 -19 1008 -26 71 -77 128 -143 163 l-51 27 -345 5 c-284 4 -349 8 -368 20 -13 8 -86 83 -163 167 -76 84 -167 176 -201 204 -113 94 -78 89 -614 89 l-470 0 -55 -26z m691 -769 c322 -68 589 -337 656 -662 25 -118 15 -322 -20 -426 -50 -150 -119 -260 -227 -363 -105 -99 -194 -152 -336 -200 -113 -38 -320 -45 -446 -15 -316 75 -562 319 -637 633 -27 113 -27 283 0 396 74 309 319 556 627 631 98 25 282 27 383 6z m841 -20 c64 -34 87 -120 49 -182 -54 -89 -187 -80 -227 14 -47 114 69 224 178 168z"/><path d="M2485 2939 c-82 -10 -167 -43 -247 -96 -335 -220 -334 -724 1 -947 167 -111 377 -130 556 -51 120 54 236 170 290 290 110 250 28 547 -195 703 -114 81 -268 119 -405 101z"/></g></svg></div>',
	'app_icons_container':'<div class="app-icons-container"></div>',
	'bottom_bar':'<div class="bottom-bar"></div>',
	'bottom_line':'<div class="bottom-line"></div>'};


let LS_KEY={PREFIX:'wallpaper_',FONT_COLOR:'fontcolor',BG_COLOR:'bgcolor',WATERMARK:'watermark'}
let kfMap={}

function createThirdContainer(iphoneScreen,key){
	let st = screenTemplate;
	iphoneScreen.append(st.dynamic_island);
	iphoneScreen.append(st.status_bar);
	iphoneScreen.append(st.time_display);
	iphoneScreen.append(st.bottom_line);
	iphoneScreen.css('width',context.getDevice().screenWidth);
	iphoneScreen.css('height',context.getDevice().screenHeight);
	
	let tc = $(st.third_container);
	tc.append(st.watermark);
	tc.append(st.desc_top);
	tc.append(iphoneScreen);
	$('.second_container').append(tc);
	iphoneScreen.click(function(event){
		uploadImg(this, $('#bgmask'));
		event.stopPropagation();
	});
	if(key in context.getDevice().createdScreens){
		delete context.getDevice().createdScreens[key].remove();
	}
	context.getDevice().createdScreens[key]=tc;
	return tc;
}
function saveAsImage() {
	$('body').css('transform','scale(1)');
	if($('div.third_container').eq(1).length){
		let $home = context.getDevice().createdScreens['home'];
		let $lock = context.getDevice().createdScreens['lock'];
		context.getDevice().screenLayout();
		doSave().then(function(success) {  
			$('div.third_container').eq(1).css('display','none');
			context.getDevice().screenLayout();
			$home[0].style.transform = this.enlarge;
			$lock[0].style.transform = this.enlarge;
			doSave().then(function(success) {  
			    $('div.third_container').eq(0).css('display','none');
				$('div.third_container').eq(1).css('display','grid');
				context.getDevice().screenLayout();
				doSave().then(function(success) {
					$home[0].style.transform = 'scale(1)';
					$lock[0].style.transform = 'scale(1)';
					$('body').css('transform','scale(0.5)');
					$('div.third_container').css('display','grid');
					context.getDevice().screenLayout();
				});
			})
		});
	}else{
		doSave().then(function(){
			$('body').css('transform','scale(0.5)');
		});
	}
}
function createLockScreen(width,height){
	let st = screenTemplate;
	let is = $(st.iphone_screen);
	let time = $(st.time_display);
	currentDateTime(time);
	is.append(time);
	is.append(st.weather);
	is.append(st.torch);
	is.append(st.camera);
	let tc = createThirdContainer(is,'lock',width,height);
	randomWeather();
	tc.find('.desc_top').html('Lock Screen');
}
function createHomeScreen(){
	let st = screenTemplate;
	let is = $(st.iphone_screen);
	is.append(st.sentence);
	is.append(st.app_icons_container);
	is.append(st.bottom_bar);
	let tc = createThirdContainer(is,'home');
	tc.find('.desc_top').html('Home Screen');
	let aic = tc.find('.app-icons-container');
	batchCreateAppItems(aic);
	randomRealAppIcons(4);
}
function bindEvent(){
	$('#introduction').click(function(){
		if($('.introduction').css('display')=='none'){
			$('.introduction').css('display','block');
		}else{
			$('.introduction').css('display','none');
		}
	});
	$('#doubleOrSingle').click(function(){
		context.getDevice().createScreens();
		let screenCount = Object.keys(context.getDevice().createdScreens).length;
		if(screenCount==2){
			$(this).html('单屏');
		}else{
			$(this).html('双屏');
		}
	});
	$('#save').click(function(){
		saveAsImage();
	});
	$('#resetScreen').click(function(){
		resetScreen('hidden');
	});
	$('.colorSelector').colorPicker(plugin.input);
	$('#appIconCount').on('input',function(){
		this.value=Math.min(this.value, iphoneIcons.length);
		if(this.value<=iphoneIcons.length){
			//appIconCount(this.value);
			randomRealAppIcons(this.value);
		}
	});
	$('#appIconCount').on('wheel', function(event) {
		changeAppIcons(this);
		this.value=Math.min(this.value, iphoneIcons.length)
		if(this.value<=iphoneIcons.length){
			//appIconCount(this.value);
			randomRealAppIcons(this.value);
		}
	});
	$('#watermark').on('input',function(){
		kfMap[this.id](this.value);
		adjustFontSize($('.watermark-container'));
	});
	
	bindHideOrShow(['.dynamic-island']);
	
	$('#mobileOrPC').click(function(){
		context.getDevice().clear();
		if(context.type=='mobile'){
			context.type='pc';
			$(this).html('移动端')
		}else{
			context.type='mobile';
			$(this).html('PC端')
		}
		initScreen();
		inputWithDefault();
	})
}



function setLS(key, value){
	localStorage.setItem(LS_KEY.PREFIX+key, value);
}
function getLS(key){
	let value = localStorage.getItem(LS_KEY.PREFIX+key);
	if(null!=value && 'null'!=value && 'undefined'!=value){
		return localStorage.getItem(LS_KEY.PREFIX+key);	
	}else{
		return '';
	}
}


function keyFunction(elementId, action) {
    let result = {[elementId]:function(...args) {action(elementId,...args);}}; 
    result[elementId](getLS(elementId))
    return result;
}
function inputWithDefault(){
	Object.assign(kfMap, keyFunction(LS_KEY.BG_COLOR, function(){
		let colorVal = arguments[1];
		$('#bgmask').css('background-image','');
		$('#bgmask').css('background-color',colorVal);
		setLS(arguments[0], colorVal);
	}), keyFunction(LS_KEY.FONT_COLOR, function(){
		let colorVal = arguments[1];
		$('#jinrishici-sentence').css('color',colorVal);
		$('.time-display, .app-name, .isp').css('color',colorVal);
		setLS(arguments[0], colorVal);
	}), keyFunction(LS_KEY.WATERMARK, function(){
		let watermarkVal = arguments[1];
		$('.watermark-container').html(watermarkVal);
		$('.copyright').html(watermarkVal);
		setLS(arguments[0], watermarkVal)
		adjustFontSize($('.watermark-container'));
	}));  
}
function adjustFontSize(element) {  
    // 假设有一个最大和最小字体大小  
    const maxFontSize = '240';  
    const minFontSize = '100';  
    // 计算内容长度或基于div的宽度和高度  
    const contentLength = element.html().length;  
    const elementWidth = context.getDevice().screenWidth;  
    // 简单的逻辑：内容越长，字体越小  
    let fontSize = maxFontSize;  
    
    if (contentLength > 2) { // 假设超过50个字符就开始减小  
        fontSize = Math.max(minFontSize, maxFontSize - (contentLength*25)); // 每多10个字符减少一点 
        
    }else{
		fontSize=maxFontSize;
	}
  	element.css('fontSize',fontSize+'px')
}  

function bindHideOrShow(classOrIds){
	for(classOrId of classOrIds){
		$(classOrId).hover(function(){
			$(this).attr('bgcolor',$(this).css('background-color'))
			$(this).css('background-color','gray');
		},function(){
			$(this).css('background-color',$(this).attr('bgcolor'));
		});
		$(classOrId).click(function(event){
			let opacity = $(this).css('opacity');
			if(opacity!=0){
				$(this).css('opacity',0);
				$(this).attr('opacity',opacity);
			}else{
				$(this).css('opacity',$(this).attr('opacity'));
			}
			$(this).attr('opacity',opacity);
			event.stopPropagation();
		})
	}
}


function changeAppIcons(inputEl){
	let val = inputEl.value
	event.preventDefault(); // 阻止默认行为（如果需要的话）
    var delta = event.deltaY; // 获取滚轮滚动的垂直距离  
	var currentValue = parseInt(val, 10) || 1; // 获取当前值，如果为空则默认为0  
    // 根据滚轮滚动的方向增加或减少值  
    if (delta < 0) {  
        // 向下滚动  
        $(inputEl).val(currentValue + 1);  
    } else {  
        // 向上滚动  
        $(inputEl).val(currentValue - 1);  
    }  
}


var plugin={};
plugin.input = {
		customBG: '#222',
		margin: '4px -2px 0',
		doRender: 'div div',

		buildCallback: function($elm) {
			var colorInstance = this.color,
				colorPicker = this;

			$elm.prepend('<div class="cp-panel">' +
				'R <input type="text" class="cp-r" /><br>' +
				'G <input type="text" class="cp-g" /><br>' +
				'B <input type="text" class="cp-b" /><hr>' +
				'H <input type="text" class="cp-h" /><br>' +
				'S <input type="text" class="cp-s" /><br>' +
				'B <input type="text" class="cp-v" /><hr>' +
				'<input type="text" class="cp-HEX" />' +
			'</div>').on('change', 'input', function(e) {
				var value = this.value,
					className = this.className,
					type = className.split('-')[1],
					color = {};

				color[type] = value;
				colorInstance.setColor(type === 'HEX' ? value : color,
					type === 'HEX' ? 'HEX' : /(?:r|g|b)/.test(type) ? 'rgb' : 'hsv');
				colorPicker.render();
				this.blur();
			});
		},

		cssAddon: // could also be in a css file instead
			'.cp-color-picker{z-index:5;box-sizing:border-box; width:30%;height:30%;}' +
			'.cp-color-picker .cp-panel {width:14%;height100%;line-height: 40px; float:right;' +
				'margin-top:-1px; overflow:visible}' +
			'.cp-xy-slider:active {cursor:none;}.cp-xy-slider{width:75%;height:92%;}' +
			'.cp-panel, .cp-panel input {color:#bbb; font-family:monospace,' +
				'"Courier New",Courier,mono; font-size:20px; font-weight:bold;}' +
			'.cp-panel input {float:right;width:70%; height:12px;' +
				'text-align:right; line-height:12px; background:transparent;' +
				'border:1px solid; border-color:#222 #666 #666 #222;}' +
			'.cp-panel hr {margin:0 -2px 2px; height:1px; border:0;' +
				'background:#666; border-top:1px solid #222;}' +
			'.cp-panel .cp-HEX {position:absolute;width:100%;height:30%;font-size:124%;color:red; margin:1px -3px 0 -2px;}' +
			'.cp-z-slider{left:-4%;width:5%;height:92%}' +
			'.cp-alpha {width:75%;}',

		renderCallback: function($elm, toggled) {
			var colors = this.color.colors.RND,
				modes = {
					r: colors.rgb.r, g: colors.rgb.g, b: colors.rgb.b,
					h: colors.hsv.h, s: colors.hsv.s, v: colors.hsv.v,
					HEX: this.color.colors.HEX
				};
			$('input', '.cp-panel').each(function() {
				this.value = modes[this.className.substr(3)];
			});
			$elm[0].value='#'+this.color.colors.HEX;
			kfMap[$elm.attr('id')]('#'+this.color.colors.HEX);
		}
	};

function resetScreen(operation){
	var screenItems = $('.iphone-screen > div');
	var excludeClasses = ['status-bar'];
	for(screenItem of screenItems){
		if(!excludeClasses.includes(screenItem.className)){
			$(screenItem).css('visibility',operation);
		}
	}
}

function doSave() {  
    return new Promise((resolve, reject) => {  
        domtoimage.toPng(document.getElementById('root_container'))  
            .then(function (dataUrl) {  
                const link = document.createElement('a');  
                link.download = 'download.png';  
                link.href = dataUrl;  
                document.body.appendChild(link); // 可能需要添加到DOM中才能触发下载  
                link.click();  
                document.body.removeChild(link); // 清理  
                resolve(true); // 图片下载并触发后解决Promise  
            })  
            .catch(function (error) {  
                reject(error); // 如果发生错误，则拒绝Promise  
                console.error('oops, something went wrong!', error);  
            });  
    });  
}  

function setBgImg(imgPaths){
	$('.iphone-screen').each(function(index, element) {
		if(imgPaths.length>1){
			$(element).css('background-image','url("'+imgPaths[index]+'")');
		}
	});
}

function getRandomNum(array) {  
    if (array.length === 0) {  
        return null; // 或者抛出错误，取决于你的需求  
    }  
    const index = Math.floor(Math.random() * array.length);  
    return array[index];  
}  

function randomWeather(){
	var weatherIcons = $('.weather').find('svg');
	weatherIcons.css('display','none');
	const index = Math.floor(Math.random() * weatherIcons.length);  
	$(weatherIcons[index]).css('display','block')

}

function rotateScreen(){
	$('.iphone-screen').css('transform','rotate(30deg)');
}
function batchCreateAppItems(aic){
	aic.empty();
	var appItemHTML='';
	let tais = context.getDevice().totalAppItems();
	for (var i = 0; i < tais; i++) {  
		appItemHTML += '<div class="app-item"><div class="app-icon"></div><div class="app-name"></div></div>';  
	}
	aic.append(appItemHTML);
}
function getRandomAppIcons(randomCount, icons){
	if(!icons){
		icons = iphoneIcons;
	}
	var sortArray = Array.from(icons);  
	// 对数组进行随机排序  
    sortArray.sort(function() {  
        return 0.5 - Math.random();  
    });
	if(!randomCount){
		randomCount=sortArray.length;
	}
	return sortArray.slice(0,randomCount);
}
function randomRenderAppIconBGColor(randomAppItems, randomCount){
	sortArray = getRandomAppIcons(randomCount, iphoneIcons);
    for(var i=0;i<sortArray.length;i++){
		$(randomAppItems[i]).find('.app-icon').css('backgroundColor','rgb(255 255 255 / 25%)');
	}
}

function randomRealAppIcons(randomCount){
	let tc = context.getDevice().createdScreens['home'];
	let aic = tc.find('.app-icons-container');
	let appItems = aic.find('.app-item');
	$('.app-icon').empty();
	$('.app-name').css('display','none');
	sortIphoneIcons = getRandomAppIcons(randomCount, iphoneIcons);
	let multiple = context.type=='pc' ? 2 : 1;
	
    for(let i=0;i<sortIphoneIcons.length;i++){
		let imgEl = '<img src="'+sortIphoneIcons[i].c+'" />';
		let appItem = $(appItems[i*multiple]);
		appItem.find('.app-icon').append(imgEl);
		appItem.find('.app-name').html(sortIphoneIcons[i].n);
		appItem.find('.app-name').css('display','block');
	}
   
    if(randomCount<=iphoneIcons.length){
		let bottomStartSkip = context.type=='mobile' ? 0 : 2;
		sortAppIcons = getRandomAppIcons(4, appIcons);
		let tais = context.getDevice().totalAppItems();
		let iconCntOneRow = context.getDevice().iconCntOneRow;
		
		for(let i=0;i<sortAppIcons.length;i++){
			let imgEl = '<img src="'+sortAppIcons[i].c+'" />';
			let index=0;
			if(context.type=='mobile'){
				index=tais-iconCntOneRow+i;	
			}else{
				index=tais-iconCntOneRow+4+i;	
			}
			$(appItems[index]).find('.app-icon').append(imgEl);
			$(appItems[index]).find('.app-name').html(sortAppIcons[i].n);
			$(appItems[index]).find('.app-name').css('display','block');
		}
    }
}

function currentDateTime(jqTimeEl){
	// 获取当前日期和时间  
    var now = new Date();  
    // 获取月份（注意：JavaScript的月份是从0开始的，所以需要+1）  
    var month = now.getMonth() + 1;  
    // 获取日期  
    var date = now.getDate();  
    // 获取星期（注意：JavaScript的getDay()返回的是0-6的数字，其中0代表星期日）  
    var dayOfWeek = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];  
    var day = dayOfWeek[now.getDay()];  
    // 获取小时和分钟  
    var hours = now.getHours();  
    var minutes = now.getMinutes();  
    if (minutes < 10) minutes = '0' + minutes; // 如果分钟小于10，前面补0  
    // 拼接时间字符串  
    var currentTime = month + '月' + date + '号 ' + day + '。' + hours + ':' + minutes;  
	screenWidth=Number($('.iphone-screen').css('width').replace('px',''));
	jqTimeEl.find('.time').css('font-size',screenWidth*0.2);
	jqTimeEl.find('.date').css('font-size',screenWidth*0.05);
	jqTimeEl.find('.date').html(month + '月' + date + '号 ' + day);
	jqTimeEl.find('.time').html(hours + ':' + minutes);
}


function uploadImg(mainEl, slaveEl){
	var existInput = $(mainEl).find('input');
	if(existInput.length>0){
		existInput.remove();
	}
	var inputEl = $('<input type="file" accept="image/*" style="display:none">');
	$(mainEl).append(inputEl);
	
	$(inputEl).on('change', function(event) {  
		console.log(32)
        const file = event.target.files[0];  
        if (!file.type.startsWith('image/')) {  
            alert('Please upload an image file.');  
            return;  
        }  
        
        const reader = new FileReader();  
        reader.onload = function(e) {  
            // 读取完成后，将结果赋值给div的background-image  
            $(mainEl).css('background-image', `url(${e.target.result})`);
            if(slaveEl){
				slaveEl.css('background-image',`url(${e.target.result})`);
			}
        };  
        // 读取文件内容为DataURL  
        reader.readAsDataURL(file);  
        
    });  
	inputEl.click(function(event){  
        event.stopPropagation();
    });
    inputEl.click();
}

let iphoneIcons = [{"n": "iTunes", "c": ""}, {"n": "WhatsApp", "c": ""}, {"n": "\u4fe1\u606f", "c": ""}, {"n": "\u5065\u5eb7", "c": ""}, {"n": "\u5e94\u7528\u5546\u5e97", "c": ""}, {"n": "\u5f85\u529e\u4e8b\u9879", "c": ""}, {"n": "\u6307\u5357\u9488", "c": ""}, {"n": "\u65b0\u95fb", "c": ""}, {"n": "\u65f6\u949f", "c": ""}, {"n": "\u7167\u7247", "c": ""}, {"n": "\u7535\u8bdd", "c": ""}, {"n": "\u76f8\u673a", "c": ""+
"LS3FJiepsVM8JE0rgcrsuEAKfEBmBIEXhHJQQXyDgb1Fz+kEI1UKj1+tRWFjYqihMXaigQCBICgKBwEBh4dQ2GsHZW6qHTseO1qCvr28gy5rdWFBYWCSsGoEg9SCEYGBg4OzuPbttUwunqs5HtdDs2bUT77//nuOqNWvrwPnVQmYEgtSDcw6NVnPmpeefdSxZulR1Pqptoffffw8f1pyUQXAmIMtCZwSCFEQOyErAH6jfvG03O3zwoOp8ItpFatuWTZBluX7FytU2jaSxRpKXQCBIPGQ5YDt14ni9JgJHMBCh0ABAwB84A/BegAuhEQhSDM55DyGkXq9Xt1dwiIiWPMuKjLPn6nv6+nqPRlQLgUCQkPT19tR8eOhgn8PuiCifiITmrTdex/qXX/JyzveL7TUFgtSCMQZC6IFt27b43t7wRkR5RTR0On7sKH7+6K+g1WqPZmXn9JrN5txEWPskEAgigxACj9fbc77p/LEf/+wXOH36dET5Rbxb1K6d23Hq5IlaznmzEBmBIDUYXjN4obb2VN2e3Tsizi9ioVm16mq88NyzA709Pe9xFrtDZkQSSaSJS5xx9PT0vPfic88OXrXmGkRKxJvQWcxmvL5hM87U1V41u7LydaPRmC0sG4EgeSEg8Hg9g2cb6u+aXTlnz+fuvh39Kldtf5RnFFh73fWQZTntW9/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"n": "\u8bbe\u7f6e", "c": ""}, {"n": "\u90ae\u4ef6", "c": ""}]
let appIcons = [{"n": "BiliBili", "c": ""}, {"n": "\u4eac\u4e1c", "c": ""}, {"n": "\u4f18\u9177", "c": ""}, {"n": "\u5c0f\u7ea2\u4e66", "c": ""}, {"n": "\u5fae\u4fe1", "c": ""}, {"n": "\u6296\u97f3", "c": ""+
"l7Ob3o87aZI+z/9F2s33kfJ15wNTPf9Qrmvul6ZM8CeY3u3AaYhHIAc/9Rlv/0E4Tv+wjd+x9lLiS6cUA3cEeSCEue8MfhMf776ft4gmCikuo4PG0L+SGVZFpeDtS6ycoJN17bwvEuCiJ8crd2jquIEcAVX1Qdld3atcdZ/RDCdwOdaP5GgXjTVk8mQZHrezybTfkmzDoSEc448BtLD/GE3+Mf7byMK/vQ/fCdrH3mqxx77pXMv+FlzLzkJpyDOxBHpoHJm066FhDc/Sgrf/lJ/D/6W+buP8qOILLDYGwEMnUr8rC8RXi8K/zu8qP89srDnDYWQ3RS3rguZKW4Rg9Mq7FuERiRh42qOhtQlzZXzao4Uhfti+qH9jgdG6BGEJWXdC/fbz0VsaIP2tU9PUd/38CzU71YksC7Unfl9BIzdAdoM6Pl5IIU1J6iobgBjROcyTvIWnIB1UBT8HLkynBCuMld4B/vuoIX6g5m/B6+Wvodl9VnX0j3jhcwe/tz8a46CHMeMOnI4vE8S+XUxd9y1+XY6LyY/ufvZvUDn0I+diczjx6ng2DSs3wTD2CjQlxZqgJqhK95fX7j7AN8cO04PSMjhUjVqkNkfZX8kH3VWg9M/tCmUcxMowTi1fJc6pTi6/VjPi9DJnnUb5aso/rK5lWlarVJC9KMAlb0Kx2VN19i5k8qKgZRuXXxiv2qikVlPfCDh03vp0TkB8sWD6H+8HIz5H6XfD6Dw7x67clPejPQ6HWNFuUVCWulkrX9FK+TbKTEh6JcqB7fvfMS3uDtZ68fecJsENB3YenQLtxbrmbm1pvxnv8svAv2gRddOpSXdOpW3noq69TtROvkrawFS/dwWdDldXpffwT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5VVVM6AnkT0uKqeCdAzwEMdla93rBwL0RPz4p7eIZ7fMY4GBG5WGSncoZTaUERUA4vv+xrkDL4kz3N7lxKQqbfHJFJPckRMAEQn462WpJ2khZvUJYAlDGdyS9n/H2fRvIGKdjNbAAAAAElFTkSuQmCC"}, {"n": "\u652f\u4ed8\u5b9d", "c": ""}, {"n": "\u65b0\u6d6a", "c": ""}, {"n": "\u7231\u5947\u827a", "c": ""}, {"n": "\u745e\u5e78", "c": ""}, {"n": "\u77e5\u4e4e", "c": ""}, {"n": "\u817e\u8baf\u89c6\u9891", "c": ""}, {"n": "\u9ea6\u5f53\u52b3", "c": ""}]

</script>  
</html>